/*
 *  Copyright 2002 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
 /*  ======== cellh263enc.c ========
 *
 */
#include <std.h>

#include <algrf.h>

#include "cellh263enc.h"

// v-table for this cell
ICELL_Fxns H263ENC_CELLFXNS = { 
    NULL,            // cellClose
    H263ENC_cellControl, // cellControl
    H263ENC_cellExecute, // cellExecute
    NULL             // cellOpen
};

/*
 *  ======== H263ENC_cellExecute ========
 *
 */
Bool H263ENC_cellExecute( ICELL_Handle handle, Arg arg )
{
    IH263ENC_Fxns  *h263encFxns   = (IH263ENC_Fxns *)handle->algFxns;
    IH263ENC_Handle h263encHandle = (IH263ENC_Handle)handle->algHandle;

    h263encFxns->encode( h263encHandle,
                     (unsigned char **)handle->inputIcc[0]->buffer,
                     (unsigned int *)handle->outputIcc[0]->buffer );
    return ( TRUE );
}

/*
 *  ======== H263ENC_cellControl ========
 *
 */
Int  H263ENC_cellControl(ICELL_Handle handle, IALG_Cmd cmd, IALG_Status *status)
{
    Int rc = 0;
    IH263ENC_Fxns  *h263encFxns   = (IH263ENC_Fxns *)handle->algFxns;
    
    if( h263encFxns->ialg.algControl != NULL ) {
        rc = h263encFxns->ialg.algControl( handle->algHandle, cmd, status );
    }
    
    return rc;
}

